package bingo.component.amchart.graphics.chart;

import java.util.ArrayList;
import java.util.List;

import bingo.component.amchart.graphics.BaseGraphic;

/**
 * Jun 25, 2008 10:37:51 AM
 * Author:yangdongyu(yangdy@bingosoft.net)
 * ReadMe:
 * ChangeLog:
 */
public class Graphs extends BaseGraphic {
	
	private List<Graph> graphList = new ArrayList<Graph>();

	/* (non-Javadoc)
	 * @see bingo.component.amchart.graphics.Graphic#getGraphicType()
	 */
	public GraphicType getGraphicType() {
		return GraphicType.graphs;
	}

	/* (non-Javadoc)
	 * @see bingo.component.amchart.graphics.Graphic#isRootElement()
	 */
	public boolean isRootElement() {
		return false;
	}

	public Graphs addGraph(Graph graph){
		this.graphList.add(graph);
		return this;
	}
	
	public Graphs addValueToGraph(int index ,Value value,Graph graph){
		try {
			while (index >= graphList.size()) {
				graphList.add(graph);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		Graph g = this.graphList.get(index);
		g.addValue(value);
		return this;
	}
	
	public List<Graph> getGraphList() {
		return graphList;
	}
	
	public void setGraphList(List<Graph> graphList) {
		this.graphList = graphList;
	}
	
	
}
